package it.sd.wdc.spider.bean;

public class ScriptStepResult {
    
    public final static int SUSPEND=-1;
    public final static int FINAL=1;
    public final static int CONTINUE=2;
    public final static int STOP=3;
    
    private final String messageResult;
    private int state;
    private String succStep;

    /**
     * 
     */
    public ScriptStepResult(String messageResult, int state) {
        this.messageResult=messageResult;
        this.state=state;
    }
    
    public ScriptStepResult(String messageResult,int state,String succStep) {
        this(messageResult,state);
        this.succStep=succStep;
    }

    
    /**
     * @return Returns the messageResult.
     */
    public String getMessageResult() {
        return messageResult;
    }
   
    /**
     * @return Returns the state.
     */
    public int getState() {
        return state;
    }
    /**
     * @param state The state to set.
     */
    public void setState(int state) {
        this.state = state;
    }
    /**
     * @return Returns the toStep.
     */
    public String getToStep() {
        if(state==STOP || state==FINAL) return null;
        return succStep;
    }
    /**
     * @param toStep The toStep to set.
     */
    public void setToStep(String succStep) {
        this.succStep = succStep;
    }
}
